package com.me.common.enums;

/**
 * 功能：
 *
 * @author：dongshibo(F_baisi)
 * @create：2019/1/23/023 16:17
 * @version：2019 Version：1.0
 * @company：老屋新房 Created with IntelliJ IDEA
 */
public enum PeopleType {
	LIUYANG("刘洋","one"),
	DABIN("大斌","two");
	private String name;
	private String numStr;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNumStr() {
		return numStr;
	}

	public void setNumStr(String numStr) {
		this.numStr = numStr;
	}

	PeopleType(String name, String numStr) {
		this.name = name;
		this.numStr = numStr;
	}

	public static boolean Contains(String name){
		return null == PeopleType.getByValue(name)?Boolean.FALSE.booleanValue():Boolean.TRUE.booleanValue();
	}

	/**
	 * 通过name获取枚举对象
	 * @param name
	 * @return
	 */
	public static PeopleType getByValue(String name){
		PeopleType values[] = PeopleType.values();
		PeopleType peopleType;
		for (int i = 0; i <values.length ; i++) {
			peopleType = values[i];
			if(peopleType.getName().equals(name)){
				return peopleType;
			}
		}
		return null;
	}
}
